<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="com.yaodian100.core.common.utils.ServerValue" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ include file="/taglibs.jsp" %>
<s:actionerror />
<s:actionmessage />
<s:fielderror />
<script language="javascript">
	$().ready(function(){
		$('#sendform').click(function(){
			if($.trim($('#giftcardId').val())==''){
				alert("请输入礼品卡卡号");
			}else{
				document.formObj.submit();
			}
		});
	});
</script>
<s:form action="queryGiftcardInfo.do" method="post" id="formObj">
	<s:hidden name="currentPage" />
	<h1>礼品卡查询</h1>
	<div class="data-form">
	<b>礼品卡卡号：</b> 
	<input type="text" name="giftcardId" id="giftcardId" value="${giftcardId}" size="50" />
	<input type="button" id="sendform"  value="搜寻">		
	</div>
</s:form>
<br />
<br />
<br />
<c-rt:if test="${not empty giftcardItem}">
	礼品卡资讯:
	<table width="100%" class="tb-data">
		
		<tr>
			<th width="10%">礼品卡卡号:</th>
			<td width="40%">${fn:substring(giftcardItem.cardCode,0,2)}-${fn:substring(giftcardItem.cardCode,2,6)}-${fn:substring(giftcardItem.cardCode,6,10)}-${giftcardItem.cardCheckCode}</td>
			<th width="10%">密码:</th>
			<td>${fn:substring(giftcardItem.cardPassword,0,5)}***</td>				
		</tr>
		<tr>
			<th>礼品卡名称:</th>
			<td>${giftcardMain.giftcardName}</td>
			<th>面额:</th>
			<td>${giftcardAmount.amount}</td>				
		</tr>
		<tr>
			<th>状态:</th>
			<td>
			<c-rt:choose>
				<c-rt:when test="${giftcardItem.status=='00'}">
					申请中
				</c-rt:when>
				<c-rt:when test="${giftcardItem.status=='50'}">
					已入库
				</c-rt:when>
				<c-rt:when test="${giftcardItem.status=='60'}">
					已领用
				</c-rt:when>
				<c-rt:when test="${giftcardItem.status=='70'}">
					已核可
				</c-rt:when>
				<c-rt:when test="${giftcardItem.status=='90'}">
					已作废
				</c-rt:when>
			</c-rt:choose>
			</td>
			<th>有效日期:</th>
			<td><fmt:formatDate value="${giftcardMain.rechargeDeadline}" pattern="yyyy-MM-dd HH:mm:ss" /></td>				
		</tr>		
		
	</table>
	<br><br>
	充值资讯:
	<table width="100%" class="tb-data">
		<tr >
			<th width="10%">是否充值:</th>
			<td width="40%">
			<c-rt:choose>
				<c-rt:when test="${giftcardItem.rechargeStatus=='0'}">
					未充值
				</c-rt:when>
				<c-rt:when test="${giftcardItem.rechargeStatus=='1'}">
					已充值
				</c-rt:when>
			</c-rt:choose>
			</td>
			<th  width="10%">充值日期:</th>
			<td><fmt:formatDate value="${giftcardItem.rechargeDate}" pattern="yyyy-MM-dd HH:mm:ss" /></td>				
		</tr>
		<tr>
			<th>充值会员:</th>
			<td><a href='../member/view.do?memberId=${giftcardItem.memberId}'>${giftcardItem.memberId}</a></td>
			<th>充值IP:</th>
			<td>${giftcardItem.rechargeIp}</td>				
		</tr>
		
	</table><br>
	<span class="txt-rd">状态为已核可才允许激活充值，其余皆不可激活充值</span>
	
	
</c-rt:if>
<c-rt:if test="${empty giftcardItem && not empty param.giftcardId}">
查无此卡号
</c-rt:if>